package cn.blogsx;
/*
使用enum关键字来定义枚举类
定义的枚举类默认继承与 java.long.Enum类
 */
public class EnumDemo2 {
    public static void main(String[] args) {
        Seanson1 seanson1 = Seanson1.SPRING;
        System.out.println(seanson1);
    }
}
enum  Seanson1 {
    //1、提供当前枚举类的对象，多个对象用逗号隔开，最后一个用分号结束
    SPRING("春天","春暖花开"),
    SUMER("夏天","夏日炎炎"),
    AUTUMN ("秋天","秋高气爽"),
    WINTER("冬天","冰天雪地");
    //1、私有化Season对象属性：private final修饰
    private final String seasonName;
    private final String seasonDesc;
    //1.私有化类的构造器
    private Seanson1 (String seasonName,String seasonDesc) {
        this.seasonName=seasonName;
        this.seasonDesc=seasonDesc;
    }

    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }
    //提供toString方法

//    @Override
//    public String toString() {
//        return "Seanson1{" +
//                "seasonName='" + seasonName + '\'' +
//                ", seasonDesc='" + seasonDesc + '\'' +
//                '}';
//    }
}
